import request from '@/utils/request';

// 查询购物车商品列表
export function listCart(query) {
	return request({
		url: '/mall/cart/list',
		method: 'post',
		data: query,
	});
}

// 查询购物车商品详细
export function getCart(id) {
	return request({
		url: '/mall/cart/getInfo',
		method: 'post',
		data: { id: id },
	});
}

// 新增购物车商品
export function addCart(data) {
	return request({
		url: '/mall/cart/add',
		method: 'post',
		data: data,
	});
}

// 编辑购物车商品
export function updateCart(data) {
	return request({
		url: '/mall/cart/edit',
		method: 'post',
		data: data,
	});
}

// 删除购物车商品
export function delCart(id) {
	return request({
		url: '/mall/cart/remove',
		method: 'post',
		data: { id: id },
	});
}

// 导出购物车商品
export function exportCart(query) {
	return request({
		url: '/mall/cart/export',
		method: 'post',
		params: query,
	});
}
